package com.itheima.controller;

import com.itheima.domain.User;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/ajax")
public class AjaxController {
    @RequestMapping("/test1")
    public String test1(String username){
        System.out.println("ajax test1...");
        return username;
    }

    @RequestMapping("/test2")
    public String test2(@RequestBody User user){
        System.out.println(user);
        return "yes";
    }

    @RequestMapping("/test3")
    public String test3(User user){
        System.out.println(user);
        return "ok";
    }
}
